﻿<!DOCTYPE html "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
  <head>  
    <link type="text/css" rel="stylesheet" href="/static/main.css" />
	<link rel="stylesheet" href="static/validationEngine.jquery.css" type="text/css"/>
    <link rel="stylesheet" href="static/template.css" type="text/css"/>
	<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
	<script src="static/jquery-1.4.4.min.js" type="text/javascript"></script>
    <script src="static/jquery.validationEngine-vi.js" type="text/javascript" charset="utf-8"></script>
    <script src="static/jquery.validationEngine.js" type="text/javascript" charset="utf-8"></script>	
	<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>


	<script type="text/javascript">  
		var map;
		var Hanoi = new google.maps.LatLng(21.029731376455562, 105.85177183532713);
		var marker;
        
		var gmarkers = [];
		var location_test;
		function HomeControl(controlDiv, map){
			controlDiv.style.padding = '5px';
	
			// Set CSS for the control border
			var controlUI = document.createElement('DIV');
			controlUI.style.backgroundColor = 'white';
			controlUI.style.borderStyle = 'solid';
			controlUI.style.borderWidth = '2px';
			controlUI.style.cursor = 'pointer';
			controlUI.style.textAlign = 'center';
			controlUI.title = 'Click to set the map to Home';
			controlDiv.appendChild(controlUI);

			// Set CSS for the control interior
			var controlText = document.createElement('DIV');
			controlText.style.fontFamily = 'Arial,sans-serif';
			controlText.style.fontSize = '12px';
			controlText.style.paddingLeft = '4px';
			controlText.style.paddingRight = '4px';
			controlText.innerHTML = 'Hà Nội';
			controlUI.appendChild(controlText);

			// Setup the click event listeners: simply set the map to Chicago
			google.maps.event.addDomListener(controlUI, 'click', function() {
				map.setCenter(Hanoi)
			});
		}  


        
		function initialize() { 
		 /* Ha Noi, Viet Nam : (21.029731376455562, 105.85177183532713)
		 Ho Chi Minh, Viet Nam(10.706426274771488, 106.4890646972656)
		 Da Nang, Viet Nam(16.037831750815293, 108.1919455566406)
		 */
		  geocoder = new google.maps.Geocoder();	
		  var myOptions = {
			zoom: 14,
			center: Hanoi,
			mapTypeId: google.maps.MapTypeId.ROADMAP
		  }
		  
		  map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); 
		  marker = new google.maps.Marker({
			  map: map,
			  icon:'http://google-maps-icons.googlecode.com/files/factory.png',
			  title:"Địa chỉ công ty"
		  });		  
		  
		  google.maps.event.addListener(map, 'click', function(event) {
			 placeMarker(event.latLng); 
			 var Lng = document.getElementById('txtLng');
			 Lng.value = event.latLng.lng(); 	 
			 var Lat = document.getElementById('txtLat');
			 Lat.value = event.latLng.lat();			 
		  }); 
		  
		  
		  var homeControlDiv = document.createElement('DIV');
		  var homeControl = new HomeControl(homeControlDiv, map);
		  homeControlDiv.index = 1;
		  map.controls[google.maps.ControlPosition.TOP_RIGHT].push(homeControlDiv);		
          

		} 
        function codeAddress() {
            var address = document.getElementById("txtViTri").value;
            geocoder.geocode( { 'address': address}, function(results, status) {
                if (status == google.maps.GeocoderStatus.OK) {
                    var location_search = results[0].geometry.location;
                    placeMarker(location_search);
                    var Lng = document.getElementById('txtLng');
                    Lng.value = location_search.lng(); 	 
                    var Lat = document.getElementById('txtLat');
                    Lat.value = location_search.lat();                   

                } else {
                    alert("Vị trí này không được tìm thấy do: " + status);
                }
            });
        }	
        
		function placeMarker(location) {
		  marker.setPosition(location);	
		  
		  location_test = location;
		  map.setCenter(location);
		} 
    
		function showAddress(address) {
          alert(address);
          if (geocoder) {
            geocoder.getLatLng(
              address,
              function(point) {
                if (!point) {
                  alert(address + " not found");
                } else {
                  placeMarker(point);
                }
              }
            );
          }
        }	         
		google.maps.event.addDomListener(window, 'load', initialize);
        

        
</script>

</head>
<body id="page1">
<div class="tail-top">
	<div class="tail-bottom">
		<div class="body-bg">
			<!-- HEADER -->
                {{menu}}
			<!-- CONTENT -->
			<div id="content">
				<div class="tail-right">
					<div class="wrapper">
						<div class="col-1">
							<div class="indent">
								<div class="indent1">
              <div class="reviewpage">
                    <div class="title_detail">
                     Thông Tin Đăng Ký
                    </div>
                    <form id ="formCompany"  enctype="multipart/form-data" action="/signCompany" method="post">
                        <div class = "editor-label">Tên công ty: </div> 
                        <div class = "editor-field"> <input class = "validate[required]] text-input" type="text" style="width: 231px;" size="40" id ="txtName" name="txtName"></div>
                        <div class = "editor-label" >Miêu tả công ty: </div> 
                        <div class = "editor-field">
                            <textarea class="validate[required] text-input"  name="txtDescription"  id ="txtDescription" rows="4" cols="40"></textarea>
                        </div>
                        <div class = "editor-label">Số điện thoại liên hệ: </div>
                        <div class = "editor-field" ><input class="validate[required,custom[phone]] text-input" id ="txtPhone" type="text" style="width: 231px;" size="40" name="txtPhone"></div>
                        <div class = "editor-label">Lĩnh vực chính: </div>
                        <div class = "editor-field">
                            <select name ="ddlLinhVuc">
                                {% for linhvuc in LinhVuc %}
                                    <option value = {{linhvuc.LinhVucID}}>{{linhvuc.TenLinhVuc}}</option>
                                {% endfor %}
                            </select>
                        </div>
                        <div  class = "editor-label">Qui mô công ty: </div>
                        <div class = "editor-field">
                            <select name ="ddlQuiMo">
                                {% for quimo in QuiMo %}
                                    <option value = {{quimo.QuiMoID}}>{{quimo.SoLuong}}</option>
                                {% endfor %}
                            </select>
                        </div>
                        <div class = "editor-label">Website: </div>
                        <div class = "editor-field"> <input type="text" style="width: 231px;" size="40" name="txtWebsite"></div>			
                        <div class = "editor-label">Ảnh đại diện: </div>			
                        <div class = "editor-field"> <input type="file" name="img"/></div>			
                        <div class = "editor-label"> Tên người liên hệ: </div>
                        <div class = "editor-field">
                        <input  class="validate[required] text-input" id ="txtContact" type="text" style="width: 231px;" size="40" name="txtContact"></div>
                        <div class = "editor-label">
                        Chọn vị trí công ty: 
                        </div>
                        <div class = "editor-field"> <input class="validate[required] text-input" type="text" style="width: 231px;" size="40" name="txtViTri" id ="txtViTri"> 
                        <input type="button" value="Go" onclick="codeAddress()" > </input> </div>
                        <br />
                        <br />
                        <div class = "editor-field" id="map_canvas" style="width:450px;height:400px"></div>
                            <div class = "editor-label">Kinh Độ:</div>
                            <div class = "editor-field">
                            <input readonly="true" class="validate[required] text-input" id ="txtLat"  style="width: 231px;" size="40" name="txtLat" id= "txtLat">
                            </div>
                            <div class = "editor-label">Vĩ Độ:</div>
                            <div class = "editor-field">
                            <input readonly="true" class="validate[required] text-input" style="width: 231px;" size="40" id ="txtLng" name="txtLng" id = "txtLng">
                            </div>
                        <div align = "center">
                             <input type="submit" value="Đăng ký ngay"/>
                        </div>
                    </form>
                </div>
                                </div>
							</div>
						</div>
						<div class="col-2">
							<ul>
								<li><strong><a href="#">Tháng 4/2011</a></strong>Qui định mới về tuyển việc làm.</li>
								<li><strong><a href="#">Tháng 5/2011</a></strong>Những yêu cầu cần có của các ứng viên khi đăng tuyển.</li>

							</ul>
						</div>
					</div>
				</div>
			</div>
			<!-- FOOTER -->
            {{footer}}
		</div>
	</div>
</div>
<script type="text/javascript"> Cufon.now(); </script>
  <script type="text/javascript">
	server = {};
	function doGetTest(){
		server.Gettest(5,7,onGetTestSuccess);
	}
  </script> 
  <script type="text/javascript">      
		$(function(){ 
			$("#formCompany").validationEngine('attach'); 
		});	
    </script>  
  <script>

	function InstallFunction(name) {
		server[name] = function() { AE_CallRemote(name, arguments); }
	}
	InstallFunction("Gettest");
</script>

</body>  

</html>